package practice2;

import java.util.Random;

public class Rabbit implements Runnable{
	private int route = 0;
	private String name = "Rabbit";
	Random r = new Random();
	public int getRoute(){
		return route;
	}
	public void run() {
		
		while (route < 20) {

			int k = 10;
			route += k;
			System.out.println(name + " goes " + k + "meters, remain:" + (20-route));
			System.out.println(name + " sleep 10 s");
			try {
				Thread.sleep(10000);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			

		}

	}
}
